layui.use(['table', 'jquery'], function (data) {
    var table = layui.table,
        $ = layui.jquery;


    var projectNo = $("input[name='projectNo']").val();
    table.render({
        elem: "#detailMaterialList",
        height: 'full-125',
        url: ctx + '/design/bomSelectByParams?projectNo=' + projectNo,
        page: true,
        cellMinWidth: 80, // 单元格最小宽度
        toolbar: '#toolbarDemo',
        cols: [[// 表头
            {type: 'checkbox'},
            {type: "numbers"},
            {title: "项目编号", field: "projectNo"},
            {title: "物料编号", field: "materialNo"},
            {title: "物料名称", field: "materialName"},
            {title: "物料数量", field: "materialCount"},
            {
                title: "物料单位", templet: function (data) {
                    console.log(data.materialBean)
                    if (data.materialBean == null) {
                        return "暂无"
                    } else {
                        return data.materialBean.materialUnit
                    }
                }
            }

        ]]
    })


})